<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>Person列表页面</h1>
<a href="/addpersonpage">添加用户</a>
<table border="1">
    <tr>
        <td>id</td>
        <td>姓名</td>
        <td>年龄</td>
        <td>班级</td>
        <td>学号</td>
        <td>删除操作</td>
        <td>更新操作</td>
    </tr>
    <tr th:each="person:${personList}">
        <td th:text="${person.id}"></td>
        <td th:text="${person.name}"></td>
        <td th:text="${person.age}"></td>
        <div th:if="${person.stuCard}!=null">
            <td th:text="${person.stuCard.classname}"></td>
            <td th:text="${person.stuCard.stuid}"></td>
            <td>
                <a th:href="@{/deleteperson(id=${person.id},stuid=${person.stuCard.id})}">删除</a>
            </td>
            <td>
                <a th:href="@{/updatepersonpage(
                id=${person.id},
                name=${person.name} ,
                age=${person.age},
                stucardid=${person.stuCard.id},
                stuid=${person.stuCard.stuid},
                classname=${person.stuCard.classname}
                )}">更新</a>
            </td>
        </div>
    </tr>
</table>
</body>
</html>